package com.example.samchat;


import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class SaveIDActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_save_id);
		
	}

	public void onClick_enter(View v){
			
		EditText idTV = (EditText)findViewById(R.id.chetID);
			
			String idStr = idTV.getText().toString();
			int strLength = idStr.length();
			
			if(strLength != 0){
				if(strLength >= 7){
					idTV.setText("");
				}
				else
				{
					TempID tID = new TempID(idStr);
					Intent intent = new Intent(getApplicationContext(), MainActivity.class);
					startActivity(intent);
				}
					
			}
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.save_id, menu);
		return true;
	}

}
